<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:myns="http://www.sci-lab.it">
<xsl:output method="xml"
	encoding="UTF-8"
	omit-xml-declaration="yes"
    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
	indent="yes"/>
<xsl:template match="/">
		  
<html xmlns="http://www.w3.org/1999/xhtml" lang="it">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta name="title" content="Home Page - Sci-Lab" />
		<meta name="author" content="Bonotto Sara, Crosato Emanuele, Tronchin Luca,  Vazzoler Raffaele" />
		<xsl:element name="meta">
			<xsl:attribute name="name">description</xsl:attribute>
			<xsl:attribute name="content">Articoli di <xsl:value-of select="$sbj" /> del portale Sci-Lab.</xsl:attribute>
		</xsl:element>
		<meta name="keywords" content="Giornale, Notizie, Scienze, Articoli, Astronomia, Biologia, Chimica, Fisica, Informatica, Matematica, Scienze della natura" />
		<meta name="language" content="italian it" />

	<title><xsl:value-of select="$sbj"/></title>
		
		<script type="text/javascript" src="../js/pageSize.js"></script>
		<script type="text/javascript" src="../js/utilities.js"></script>
		
		<link type="text/css" rel="stylesheet" href="../style/screen.css" media="screen" />
		<link type="text/css" rel="stylesheet" href="../style/print.css" media="print" />
	</head>

	<body onload="pageSize(); checkUserAgent('no');">
		<div id="contenitoreTutto">
			<div id="header">
				<div id="logo">SCI - LAB</div>
			</div>
		
			<div id="path">
				Ti trovi in: <a href="../transforms/home.html">Home</a> &gt;&gt; <xsl:value-of select="$sbj"/>
			</div>
		
			<div id="contenitoreMenu">
				<div id="menu">
					<div class="center" > <strong>MENU</strong> </div>
					<div>
						<dl>
							<dt class="marginBottom"><a href="home.html" hreflang="it" title="Home page" accesskey="h" tabindex="1" >Home (h)</a></dt>
							
							<xsl:if test="not($sbj='Astronomia')">
								<dt> <a href="Astronomia1.html" hreflang="it" title="Astronomia" accesskey="a" tabindex="2"> Astronomia (a)</a> </dt>
							</xsl:if>
							<xsl:if test="$sbj='Astronomia'">
								<dt> Astronomia </dt>
							</xsl:if>
							<xsl:if test="not($sbj='Biologia')">
								<dt> <a href="Biologia1.html" hreflang="it" title="Biologia" accesskey="b" tabindex="3"> Biologia (b)</a> </dt>
							</xsl:if>
							<xsl:if test="$sbj='Biologia'">
								<dt> Biologia </dt>
							</xsl:if>
							<xsl:if test="not($sbj='Chimica')">
								<dt> <a href="Chimica1.html" hreflang="it" title="Chimica" accesskey="c" tabindex="4"> Chimica (c)</a> </dt>
							</xsl:if>
							<xsl:if test="$sbj='Chimica'">
								<dt> Chimica </dt>
							</xsl:if>
							<xsl:if test="not($sbj='Fisica')">
								<dt> <a href="Fisica1.html" hreflang="it" title="Fisica" accesskey="g" tabindex="5"> Fisica (g)</a> </dt>
							</xsl:if>
							<xsl:if test="$sbj='Fisica'">
								<dt> Fisica </dt>
							</xsl:if>
							<xsl:if test="not($sbj='Informatica')">
								<dt> <a href="Informatica1.html" hreflang="it" title="Informatica" accesskey="i" tabindex="6"> Informatica (i)</a> </dt>
							</xsl:if>
							<xsl:if test="$sbj='Informatica'">
								<dt> Informatica </dt>
							</xsl:if>
							<xsl:if test="not($sbj='Matematica')">
								<dt> <a href="Matematica1.html" hreflang="it" title="Matematica" accesskey="m" tabindex="7"> Matematica (m)</a> </dt>
							</xsl:if>
							<xsl:if test="$sbj='Matematica'">
								<dt> Matematica </dt>
							</xsl:if>
							<xsl:if test="not($sbj='Scienze della Natura')">
								<dt class="marginBottom"> <a href="Scienze%20della%20Natura1.html" hreflang="it" title="Scienze della Natura" accesskey="n" tabindex="8"> Scienze della natura (n)</a> </dt> 
							</xsl:if>
							<xsl:if test="$sbj='Scienze della Natura'">
								<dt class="marginBottom"> Scienze della natura </dt>
							</xsl:if>
							
							<dt><a href="../static_html/whatIsSciLab.html" hreflang="it" title="Sviluppatori" accesskey="s" tabindex="9" > Cos'&#232; Sci-Lab (s)</a></dt>
							<dt><a href="../static_html/workWithUs.html" hreflang="it" title="Lavora con noi" accesskey="l" tabindex="10" >Lavora per noi (l)</a></dt>
							<dt><a href="../cgi-bin/reservedArea.cgi" hreflang="it" title="Area riservata" accesskey="v" tabindex="11" > Area riservata (v)</a></dt>
							<dt><a href="../static_html/siteMap.html" hreflang="it" title="Mappa del sito" accesskey="z" tabindex="12" > Mappa del sito (z)</a></dt>
						</dl>
						<br />
						
						<form action="../cgi-bin/generateSearch.cgi" method="get">
							<div id="centerFind">
								<label for="search">CERCA ARTICOLI </label><br />
								<input type="text" name="search" title="Inserisci delle parole chiave" id="search" /> <br />
								<input type="submit" value="Cerca" title="Avvia ricerca" />
	 						</div>
	 					</form>
					</div>
				</div>
			</div>
		
			<div id="contentHome">
				<div id="titleSubject"><h1><xsl:value-of select="$sbj"/></h1></div>
				<div class="pages">
				
					<xsl:call-template name="showPages">
						<xsl:with-param name="n" select="$tot"/>
						<xsl:with-param name="sbj" select="$sbj"/>
					</xsl:call-template>
				</div>
				
				<xsl:for-each select="myns:articles/myns:article[myns:subject=$sbj]">
					
					<xsl:variable name="varTitle" select="myns:title"/>
					<xsl:variable name="titleLink">
						<xsl:call-template name="replaceCharsInString">
							<xsl:with-param name="stringIn" select="string($varTitle)"/>
							<xsl:with-param name="charsIn" select="' '"/>
							<xsl:with-param name="charsOut" select="'-'"/>
						</xsl:call-template>
					</xsl:variable>
					<xsl:variable name="titleLinkString" select="string($titleLink)"/>
					
					<div class="article">
						<xsl:element name="a">
							<xsl:attribute name="href"><xsl:value-of select="myns:subject"/>/<xsl:value-of select="$titleLinkString"/>.html</xsl:attribute>
							<span class="image">
								<xsl:element name="img">
									<xsl:attribute name="src">../img/<xsl:value-of select="myns:subject"/>.jpg</xsl:attribute>
									<xsl:attribute name="alt">immagine di <xsl:value-of select="myns:subject"/></xsl:attribute>
									<xsl:attribute name="height">80</xsl:attribute>
									<xsl:attribute name="width">100</xsl:attribute>
								</xsl:element>
							</span> 
						</xsl:element>
								
							<div class="contenitore">	
							<div class="subject"> <xsl:value-of select="myns:subject"/></div>
							<div class="date"> <xsl:value-of select="myns:date"/> </div> <br /> <br />
							<h2><xsl:element name="a">
								<xsl:attribute name="href"><xsl:value-of select="myns:subject"/>/<xsl:value-of select="$titleLinkString"/>.html</xsl:attribute>
								<span class="title"> <xsl:value-of select="myns:title"/> </span>
							</xsl:element></h2>
							<div class="abstract"><xsl:value-of select="myns:abstract"/></div>
							<div class="author"> <em>di <xsl:value-of select="/myns:articles/myns:article/myns:author" /></em></div>
						</div>
					</div>
					
				</xsl:for-each>
				
				<div class="pages">
					<xsl:call-template name="showPages">
						<xsl:with-param name="n" select="$tot"/>
						<xsl:with-param name="sbj" select="$sbj"/>
					</xsl:call-template>
				</div>
				
			</div>
			
			<div id="login">
				<script type="text/javascript">
					is_logged("no","no","transforms/<xsl:value-of select="$sbj" /><xsl:value-of select="$page"/>.html");
				</script>
			</div>
			
		</div>
				
		<div id="footer">
			<div class="imageCertification">
				<img src="../img/css.gif" title="Validazione CSS" alt="Sito certificato secondo le regole css" width="100" height="32" />
			</div>
			<div class="imageCertification">
				<img src="../img/html.png" title="Validazione XHTML" alt="Sito certificato secondo le regole xhtml 1.0" width="100" height="32" />
			</div>
			<div class="imageCertification">
				<img src="../img/wai_aaa.gif" title="Validazione WCAG" alt="Livello di accessibilita' del sito AAA " width="100" height="32" />  
			</div>
		</div>
	</body>
</html>

</xsl:template>

<xsl:template name="showPages" xmlns="http://www.w3.org/1999/xhtml">
	<xsl:param name="n"></xsl:param>
	<xsl:param name="sbj"></xsl:param>
	<xsl:if test="$n>0">
		<xsl:call-template name="showPages">
			<xsl:with-param name="n" select="$n - 1"/>
			<xsl:with-param name="sbj" select="$sbj"/>
		</xsl:call-template>
		<xsl:element name="a">
			<xsl:attribute name="href">
				<xsl:value-of select="$sbj"/>
				<xsl:value-of select="$n"/>
				<xsl:text>.html</xsl:text>
			</xsl:attribute>
			<xsl:value-of select="$n"/>
		</xsl:element>
	</xsl:if> 
</xsl:template>

<xsl:template name="replaceCharsInString">
  <xsl:param name="stringIn"/>
  <xsl:param name="charsIn"/>
  <xsl:param name="charsOut"/>
  <xsl:choose>
    <xsl:when test="contains($stringIn,$charsIn)">
      <xsl:value-of select="concat(substring-before($stringIn,$charsIn),$charsOut)"/>
      <xsl:call-template name="replaceCharsInString">
        <xsl:with-param name="stringIn" select="substring-after($stringIn,$charsIn)"/>
        <xsl:with-param name="charsIn" select="$charsIn"/>
        <xsl:with-param name="charsOut" select="$charsOut"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$stringIn"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>


</xsl:stylesheet>